/**
XenSim simulates xenbal.
Copyright (C) 2006 Travis Vachon

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
package xensim;

public class MigrationEvent extends Event {
	Node source;
	Node dest;
	
	Domain domain;
	
	
	public MigrationEvent(double time, Node source, Domain domain, Node dest) {
		super(time);
		this.source = source;
		this.dest = dest;
		this.domain = domain;
	}

	@Override
	public void execute() {
		if(SimGlobals.DEBUG){
			System.out.println("Migrating " + source.name + " domain " +domain.name+" to "+ dest.name);
		}
		if(!source.migrate(domain, dest)){
			System.out.println("Migration of " + domain.name + " from " + source.name + " to " + dest.name + " failed.");
		}

	}

}
